From: Cosimo Cecchi Date: Fri, 30 Nov 2012 00:21:41 +0000 (-0500) Subject: appDisplay: don't increment counter if we didn't add a category X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~5345 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=e58fbeea1756d199ed95b33b5a533597746b37a8;p=gnome-shell.git appDisplay: don't increment counter if we didn't add a category Or we'll later try to jump to the wrong category when clicking on it. --- diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 300c7e75a..851a5118d 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -223,7 +223,7 @@ const ViewByCategories = new Lang.Class({ this._loadCategory(dir, apps); if (apps.length == 0) - return; + return false; } let button = new St.Button({ label: GLib.markup_escape_text (name, -1), @@ -244,6 +244,7 @@ const ViewByCategories = new Lang.Class({ } this._categoryBox.add(button, { expand: true, x_fill: true, y_fill: false }); + return true; }, _removeAll: function() { @@ -269,8 +270,9 @@ const ViewByCategories = new Lang.Class({ var dir = iter.get_directory(); if (dir.get_is_nodisplay()) continue; - this._addCategory(dir.get_name(), i, dir); - i++; + + if (this._addCategory(dir.get_name(), i, dir)) + i++; } }